Read boot mode register using pm_mmio_read if pmu is
present otherwise access it directly using mmio_read_32().
Signed-off-by: Siva Durga Prasad Paladugu <[email protected]>
Acked-by: Michal Simek <[email protected]>
#include <platform.h>
#include <xlat_tables.h>
#include "../zynqmp_private.h"
+#include "pm_api_sys.h"
/*
* Table of regions to map using the MMU.
unsigned int zynqmp_get_bootmode(void)
{
- uint32_t r = mmio_read_32(CRL_APB_BOOT_MODE_USER);
+ uint32_t r;
+
+ if (zynqmp_is_pmu_up())
+ pm_mmio_read(CRL_APB_BOOT_MODE_USER, &r);
+ else
+ r = mmio_read_32(CRL_APB_BOOT_MODE_USER);
return r & CRL_APB_BOOT_MODE_MASK;
}